package com.salt.utils;

import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaIdleAffiliateMaterialGuideGetRequest;
import com.taobao.api.response.AlibabaIdleAffiliateMaterialGuideGetResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import com.salt.config.TaobaoConfig;

@Slf4j
@Component
public class TaobaoApiUtil {
    
    private final TaobaoClient client;
    
    public TaobaoApiUtil(TaobaoConfig config) {
        String serverUrl = config.isUseHttps() 
            ? "https://eco.taobao.com/router/rest"
            : "http://gw.api.taobao.com/router/rest";
            
        this.client = new DefaultTaobaoClient(
            serverUrl,
            config.getAppKey(),
            config.getAppSecret()
        );
    }

} 